<template>
  <div>
    <div class="ccui-navigation">
      <el-button
          size="mini"
          type="primary-icon-medium"
          icon="icon-ccui-return"
          @click="handleBack"
      >返回
      </el-button
      >
      <div class="ccui-navigation-divider"/>
      <!-- 面包屑 -->
      <el-breadcrumb
          class="ccui-navigation-crumbs-container"
          separator-class="el-icon-arrow-right"
      >
        <el-breadcrumb-item
            :to="{ path: $store.getters.getBreadcrumb('level1').path }"
        >{{ $store.getters.getBreadcrumb("level1").name }}
        </el-breadcrumb-item
        >
        <el-breadcrumb-item
            :to="{
            path: '/inventoryManagement/storeManagement/storeManagementList'
          }"
        >库存理管(财务)
        </el-breadcrumb-item
        >
        <el-breadcrumb-item
            :to="{
            path: '/inventoryManagement/storeManagement/storeManagementList'
          }"
        >仓库管理
        </el-breadcrumb-item
        >
        <el-breadcrumb-item
            :to="{
            path: '/inventoryManagement/storeManagement/storeManagementList'
          }"
        >仓库维护
        </el-breadcrumb-item
        >
        <el-breadcrumb-item>
          <span>查看</span>
          <span class="ccui-curr-crumb ccui-ml-10">
            {{ titleName }}
          </span>
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="ccui-app-container-detail">
      <div class="ccui-app-container-detail-body">
        <el-group-title title="仓库信息">
          <template slot="groupTitle">
            <el-form
                :model="form"
                ref="form"
                label-width="160px"
                class="ccui-form"
            >
              <el-row>
                <el-col :span="12">
                  <el-form-item label="填报单位：">
                    <div>{{ form.reportInOrgName }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="库存地点：">
                    <div>{{ form.warehousePlace }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <!--项目名称、核算组织-->
              <el-row>
                <el-col :span="12">
                  <el-form-item label="项目名称：">
                    <div>{{ form.projectName }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="核算组织：">
                    <div>{{ form.accountingOrgan }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="仓库编号：" prop="warehouseCode">
                    <div>{{ form.warehouseCode }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="仓库名称：" prop="warehouseName">
                    <div>{{ form.warehouseName }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <!--本位币币种、计税方式-->
              <el-row>
                <el-col :span="12">
                  <el-form-item label="本位币币种：" prop="warehouseCode">
                    <div>{{ form.standardMoney }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="计税方式：" prop="warehouseName">
                    <div>{{ form.valoremMethod }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="联系电话：" prop="warehousePhone">
                    <div>{{ form.warehousePhone }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="编制人：">
                    <div>{{ form.compilePeople }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="编制时间：">
                    <div>{{ form.compileDate }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                      label="仓库描述："
                      :title="form.warehouseDescribe"
                  >
                    <div>{{ form.warehouseDescribe }}</div>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </template>
        </el-group-title>
      </div>
    </div>
    <el-bottom-guide>
      <ul class="ccui-bottom-button">
        <li>
          <el-button type="bottom" icon="icon-ccui-return" @click="handleBack"
          >返回
          </el-button
          >
        </li>
      </ul>
    </el-bottom-guide>
  </div>
</template>

<script>
import {getStoreDetail} from "../api";

export default {
  name: "storeManagementDetails",
  data() {
    return {
      form: {},
      titleName: ""
    };
  },
  props: {},
  watch: {},
  mounted() {
    if (this.$route.query.id) {
      let id = this.$route.query.id;
      this.getStoreDetail({id: id});
    }
  },
  methods: {
    //查详情
    getStoreDetail(data) {
      getStoreDetail(data).then(res => {
        if (res.data.code == 0) {
          this.form = res.data.data;
          this.titleName = this.form.warehouseName;
          if (res.data.data.compileDate) {
            this.form.compileDate = this.form.compileDate.substring(0, 10);
          }
        }
      });
    },
    //返回
    handleBack() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped lang="scss"></style>
